Skip to content

Comments

[sunsynk] Add support for solar strings, fix for battery status and misc improvements#19506

Merged
lsiepel merged 12 commits intoopenhab:mainfrom
LeeC77:Sunynk-Updates
Oct 25, 2025
Merged

[sunsynk] Add support for solar strings, fix for battery status and misc improvements#19506
lsiepel merged 12 commits intoopenhab:mainfrom
LeeC77:Sunynk-Updates

Conversation

@LeeC77
Copy link
Contributor

@LeeC77 LeeC77 commented Oct 19, 2025

Improvements to binding.sunsynk

Sparked by a bug and feature requests here:
https://community.openhab.org/t/new-sun-synk-connect-account-and-inverter-binding/155680/11?u=leec77

The JAR is here if you want to test: Build JAR

Corrected the status update of the channels.

  • Battery Current
  • Battery Power
  • Battery Voltage

Added support for.

  • Grid frequency
  • Inverter capacity

Added support for solar panel strings.

  • Solar String 1 Voltage, Current and Power
  • Solar String 2 Voltage, Current and Power
  • Solar Energy today, this month, this year and total
  • Solar Efficiency and current ac-power

Robustness improvements

  • Fixed API call rate limit
  • Added trace logging. API response now logged
  • Improved logging messages
  • caught possible additional exception

Readme updated

  • Added description of new items
  • Added description of new Thing configuration required to support new items
  • Added further notes on API call rate control
  • Adde concrete equipment tested

@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/new-sun-synk-connect-account-and-inverter-binding/155680/13

@lsiepel
Copy link
Contributor

lsiepel commented Oct 19, 2025

Could you please seperate bug fixes and enhancements? This makes it easier to review, backport and properly add it to the release notes.

@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/new-sun-synk-connect-account-and-inverter-binding/155680/1

@LeeC77
Copy link
Contributor Author

LeeC77 commented Oct 19, 2025

Could you please separate bug fixes and enhancements? This makes it easier to review, backport and properly add it to the release notes.

Do you want two separate Pull Requests or just separated git commits?
I assumed separate commits

…attery-dc

Signed-off-by: LeeC77 <lee.charlton00@gmail.com>
Signed-off-by: LeeC77 <lee.charlton00@gmail.com>
@jlaur jlaur changed the title Updates to support Solar strings, fixes for battery status and misc improvments. [sunsynk] Updates to support Solar strings, fixes for battery status and misc improvments. Oct 19, 2025
@lsiepel
Copy link
Contributor

lsiepel commented Oct 20, 2025

Could you please separate bug fixes and enhancements? This makes it easier to review, backport and properly add it to the release notes.

Do you want two separate Pull Requests or just separated git commits? I assumed separate commits

I meant seperate PR's

@LeeC77
Copy link
Contributor Author

LeeC77 commented Oct 20, 2025

I meant seperate PR's

Given that the fix is so trivial is this necessary? Understand I got it wrong could it be overlooked please.

@lsiepel
Copy link
Contributor

lsiepel commented Oct 20, 2025

I meant seperate PR's

Given that the fix is so trivial is this necessary? Understand I got it wrong could it be overlooked please.

Not a big issue, but as a consequence i prefer not to backport this PR. For future PR's please remember this.

@lsiepel lsiepel requested a review from Copilot October 20, 2025 18:20
@lsiepel lsiepel added the enhancement An enhancement or new feature for an existing add-on label Oct 20, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for solar string data collection, fixes battery status channel updates, and includes various robustness improvements for the SunSynk binding. The changes enable monitoring of individual solar strings (voltage, current, power), plant-level solar statistics, and grid frequency, while improving API error handling and rate limiting.

Key changes:

  • Added support for two solar string channels (voltage, current, power) and plant-level summary data (energy totals, efficiency, AC power, inverter capacity)
  • Fixed battery channel constant names (changed from "battery-grid-" to "battery-dc-")
  • Enhanced API error handling with per-call status tracking and improved logging

Reviewed Changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
thing-types.xml Added new channel definitions for solar strings, grid frequency, inverter capacity, and plant summary data; fixed spelling errors
sunsynk.properties Added i18n strings for new channels and corrected spelling errors
SunSynkInverterHandler.java Implemented new channels, added status flag checking for API calls, and improved error messages
SunSynkHandlerFactory.java Updated debug messages with version identifier
SunSynkAccountHandler.java Improved error messages and bridge status updates
SunSynkAccountDiscoveryService.java Added plant ID and name to discovered inverter properties
SunSynkInverterConfig.java Added plantId and plantName configuration fields
PlantSummary.java New DTO class for plant summary data from API
RealTimeInData.java Refactored to track individual string data instead of aggregated solar power
DeviceController.java Added plant summary API call, improved URL construction, enhanced error handling with status flags
Grid.java Added grid frequency getter and fixed spelling in toString
Details.java Added plant ID and name extraction from API response
Client.java Fixed spelling errors in comments and strings
Battery.java Added getters for code and msg fields
Daytemps.java Added getters for code and msg fields
Inverter.java Added plantId and plantName fields with getters/setters
Settings.java Added getters for code and msg fields; fixed spelling in toString
SunSynkLogin.java Fixed spelling in comment
AccountController.java Improved error messages, refresh token validation, and trace logging
SunSynkBindingConstants.java Added new channel constants and fixed battery channel constant names
feature.xml Added commented-out alternative configuration lines
README.md Updated documentation with new channels, plant configuration requirements, and tested equipment list

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

…e typo.

Signed-off-by: LeeC77 <lee.charlton00@gmail.com>
…ines

Signed-off-by: LeeC77 <lee.charlton00@gmail.com>
Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for providing this PR and the time you took to fix all typo's. Besides these comments, the thing upgrade instructions are missing.

…ation and code

Signed-off-by: LeeC77 <lee.charlton00@gmail.com>
…bility

Signed-off-by: LeeC77 <lee.charlton00@gmail.com>
Signed-off-by: LeeC77 <lee.charlton00@gmail.com>
Signed-off-by: LeeC77 <lee.charlton00@gmail.com>
Signed-off-by: LeeC77 <lee.charlton00@gmail.com>
@LeeC77
Copy link
Contributor Author

LeeC77 commented Oct 25, 2025

Thanks for providing this PR and the time you took to fix all typo's. Besides these comments, the thing upgrade instructions are missing.

I hope I did this correct: added thing upgrade instructions.

Signed-off-by: LeeC77 <lee.charlton00@gmail.com>
Signed-off-by: LeeC77 <lee.charlton00@gmail.com>
@LeeC77 LeeC77 requested a review from lsiepel October 25, 2025 19:13
Signed-off-by: LeeC77 <lee.charlton00@gmail.com>
Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@lsiepel lsiepel merged commit e009276 into openhab:main Oct 25, 2025
2 checks passed
@lsiepel lsiepel added this to the 5.1 milestone Oct 25, 2025
@lsiepel lsiepel changed the title [sunsynk] Updates to support Solar strings, fixes for battery status and misc improvments. [sunsynk] Add support for solar strings, fix for battery status and misc improvments Oct 25, 2025
@lsiepel lsiepel changed the title [sunsynk] Add support for solar strings, fix for battery status and misc improvments [sunsynk] Add support for solar strings, fix for battery status and misc improvements Oct 25, 2025
@LeeC77
Copy link
Contributor Author

LeeC77 commented Oct 25, 2025

Thanks, LGTM

Thanks Isiepel for your review and support, I'm still learning and your help makes this easy. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An enhancement or new feature for an existing add-on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants